# 地址：http://121.40.86.4:8899/admin/login
# 账号：admin
# 密码：Aa010903!
# 用例一：
# 1、用户登录
# 2、点击用户
# 3、点击用户分组
# 4、添加用户分组
# 5、判断添加是否成功
# 6、删除用户分组
# 7、判断删除是否是成功的
# import time
# from selenium import webdriver
# from selenium.webdriver.common.by import By
# from selenium.webdriver.support.ui import WebDriverWait
# from selenium.webdriver.support import expected_conditions as EC
#
# driver = webdriver.Chrome()
# driver.get("http://121.40.86.4:8899/admin/login")
# driver.maximize_window()
# driver.implicitly_wait(15)
# driver.find_elements(By.CLASS_NAME,"el-input__inner")[0].send_keys("admin")
# driver.find_elements(By.CLASS_NAME,"el-input__inner")[1].send_keys("Aa010903!")
# driver.find_element(By.XPATH,"//*[text()='登录']").click()
# time.sleep(3)
# driver.find_elements(By.CLASS_NAME,"font12")[1].click()
# time.sleep(3)
# driver.find_element(By.XPATH,"//*[text()='用户分组']").click()
# time.sleep(3)
# # driver.find_element(By.XPATH,"//*[text()='添加分组']").click()
# # time.sleep(3)
# # driver.find_elements(By.CLASS_NAME,"el-input__inner")[2].send_keys('zuoye')
# # time.sleep(2)
# # driver.find_elements(By.CLASS_NAME,"el-button")[2].click()
# # time.sleep(3)
# # text= driver.find_element(By.XPATH,"//*[@id='app']/section/div[2]/section/div/div[1]/div/main/div/div[1]/div/div[1]/div/div/div/div[2]/div[3]/table/tbody/tr[2]/td[2]/div/span").text
# # assert text == "zuoye"
# # time.sleep(3)
# driver.find_elements(By.XPATH,*[@id='app']/section/div[2]/section/div/div[1]/div/main/div/div[1]/div/div[1]/div/div/div/div[2]/div[4]/div[2]/table/tbody/tr[2]/td[3]/div/a[2])





# 用例二：
# 1、登录
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome()
driver.get("http://121.40.86.4:8899/admin/login")
driver.maximize_window()
driver.implicitly_wait(15)
driver.find_elements(By.CLASS_NAME,"el-input__inner")[0].send_keys("admin")
driver.find_elements(By.CLASS_NAME,"el-input__inner")[1].send_keys("Aa010903!")
driver.find_element(By.XPATH,"//*[text()='登录']").click()
time.sleep(3)
# 2、点击客服
driver.find_elements(By.CLASS_NAME,"layout-columns")[6].click()
time.sleep(3)
# 3、客服话术
driver.find_element(By.XPATH,"//*[text()='客服话术']").click()
time.sleep(3)
# 4、新增客服话术
driver.find_element(By.XPATH,"//*[text()='添加话术']").click()
time.sleep(3)
driver.find_elements(By.CLASS_NAME,"el-textarea__inner")[0].send_keys('wangjingyao')
time.sleep(3)
driver.find_elements(By.CLASS_NAME,"el-textarea__inner")[-1].send_keys('6')
time.sleep(3)
driver.find_elements(By.CLASS_NAME,"el-button")[2].click()
time.sleep(3)
# 5、看新增是否是成功的
# #判断删除是否是成功的
# text = driver.find_element(By.XPATH,"//*[text()='wangjingyao']").text
# assert text == 'wangjingyao'
# time.sleep(2)

